import string
def sm(strs):
    smlist = 'bpmfdtnlgkhjqxrzcsyw'
    nosm = ['eR','aN','eN','iN','uN','vN','nG','NG']
    rep = {'ZH':'Zh','CH':'Ch','SH':'Sh'}
    for s in smlist:
        strs = strs.replace(s,s.upper())
    for s in nosm:
        strs = strs.replace(s,s.lower())
    for s in rep.keys():
        strs = strs.replace(s,rep[s])
    for s in nosm:
        tmp_num = 0
        isOk = False
        while (tmp_num < len(strs)) and (isOk==False):
            try:
                tmp_num = strs.index(s.lower(),tmp_num)
            except:
                isOk = True
            else:
                tmp_num = tmp_num + len(s)
    if strs[tmp_num:tmp_num+1].lower() not in smlist:
        strs = strs[:tmp_num-1]+strs[tmp_num-1:tmp_num].upper()+strs[tmp_num:]
    lis=[]
    for c in strs:
        if c in string.ascii_uppercase:
            lis.append(c.lower())
        else:
            lis[-1]+=c
    return lis
